#include <iostream>
#include <algorithm>
#include <cstdio>
#include <array>
#define pii pair <int, int>
#define db double
using namespace std;
#ifdef ONLINE_JUDGE

#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
char buf[1 << 23], *p1 = buf, *p2 = buf, ubuf[1 << 23], *u = ubuf;

#endif
int read() {
    int p = 0, flg = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') flg = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        p = p * 10 + c - '0';
        c = getchar();
    }
    return p * flg;
}
void write(int x) {
    if (x < 0) {
        x = -x;
        putchar('-');
    }
    if (x > 9) {
        write(x / 10);
    }
    putchar(x % 10 + '0');
}
bool _stmer;

#define fi first
#define se second

const int N = 505, inf = 2e9;

array <array <double, N>, N> f;
array <pii, N> s;

array <array <pii, N>, N> g;

bool _edmer;
int main() {
    cerr << (&_stmer - &_edmer) / 1024.0 / 1024.0 << "MB\n";
#ifndef cxqghzj
    freopen("talk.in", "r", stdin);
    freopen("talk.out", "w", stdout);
#endif
    int n = read(), m = read();
    for (int i = 1; i <= n; i++) {
        s[i].fi = read(), s[i].se = read();
        if (!~s[i].se) s[i].se = inf;
    }
    sort(s.begin() + 1, s.begin() + 1 + n, [](pii x, pii y) {
        return x.se < y.se;
    });
    for (int i = 0; i <= n; i++)
        g[i] = s, sort(g[i].begin() + 1 + i, g[i].begin() + 1 + n);
#define upd(x, y) (x = min(x, y))
    db ans = 0;
    for (int i = 1; i <= m; i++)
        ans += g[0][i].fi;
    for (int l = 1; l <= m; l++) {
        for (int i = 0; i <= n; i++)
            f[i].fill(4e18);
        f[0][0] = 0;
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j <= l; j++) {
                upd(f[i][j], f[i - 1][j] + (db)s[i].fi / (l + 1));
                if (j) upd(f[i][j], f[i - 1][j - 1] + (db)s[i].se / j);
            }
            if (i < l) continue;
            db sum = 0;
            for (int j = i + 1; j <= m; j++)
                sum += (db)g[i][j].fi / (l + 1);
            ans = min(ans, sum + f[i][l]);
        }
    }
    printf("%.6lf\n", ans);
    return 0;
}
